import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
// import 'rxjs/add/operator/delay';
import { BrowserPage } from '../browser/browser';
// import { HttpService } from '../../providers/http-service/http-service';
// import { Http, Response } from '@angular/http';
import { ToastController } from 'ionic-angular';
import { ContactPage } from '../contact/contact';



@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  listData: any;
  public randomBoolean: boolean = false;
  constructor(public navCtrl: NavController,
    // public http: HttpService,
    public toast: ToastController

  ) {

    this.randomBoolean = true;

  }
  aa(e) {
    if (this.randomBoolean === true) {
      let toast = this.toast.create({
        message: 'User was added successfully',
        duration: 3000,
        position: 'top'

      })
     
      toast.present();
    } else if (this.randomBoolean === false) {
         this.navCtrl.push(ContactPage)

    }
   
  }
  openUrl() {
    this.navCtrl.push(BrowserPage, {
      browser: {
        title: '百度',
        url: 'https://192.168.0.37:8080/wap'
      }
    });
  }

 
  
}

